package seatiger.tomcat.naming.resources;


import java.io.File;

public class DirContextTest {
    public static void main(String[] args) throws Exception{
        FileDirContext dirContext = new FileDirContext();
        String path = System.getProperty("user.dir") + File.separator + "myApp";
        dirContext.setDocBase(path);
        String name = "seatiger.tomcat.test.servlet.TestServlet1".replace(".", File.separator) + ".class";
        Object lookup = dirContext.lookup(name);
        ResourceAttributes attributes = (ResourceAttributes) dirContext.getAttributes(name);
        System.out.println(lookup);
        System.out.println(attributes.getContentLength());
    }
}
